<?php
declare(strict_types=1);

use Hyperf\HttpServer\Router\Router;

Router::post('/user/login', 'App\Controller\User\AuthController@login'); //登录
Router::post('/user/register', 'App\Controller\User\AuthController@register'); //注册
Router::post('/user/login-wx-mini', 'App\Controller\User\AuthController@wxCodeAuth'); //微信小程序code登录
Router::post('/user/card-info', 'App\Controller\User\CardController@cardInfo'); //会员卡详细 无需权限认证
Router::post('/user/bind-phone', 'App\Controller\User\AuthController@bindUser'); //绑定账号


/**
 * 用户相关api
 */
Router::addGroup('/user',function () {
    Router::post('/info','App\Controller\User\UserController@userInfo'); //获取授权用户登录信息
    Router::post('/logout','App\Controller\User\AuthController@logOut'); //退出登录
    Router::post('/update','App\Controller\User\UserController@updateUser'); //更新用户信息
    Router::post('/messages','App\Controller\User\UserController@myMessages'); //我的消息
    Router::post('/total-nums','App\Controller\User\UserController@userCateTotals'); //获取类目和会员数量
    Router::post('/batch-category-save','App\Controller\User\CategoryController@batchSave'); //批量设置类目信息
    Router::post('/category-save','App\Controller\User\CategoryController@saveCategory'); //单个类目信息
    Router::post('/category-remove','App\Controller\User\CategoryController@remove'); //单个类目移除
    Router::post('/category-data','App\Controller\User\CategoryController@allCategory'); //获取所有类目
    Router::post('/account-list','App\Controller\User\AccountController@accountList'); //用户账册列表
    Router::post('/account-save','App\Controller\User\AccountController@accountSave'); //用户账册保存
    Router::post('/account-remove','App\Controller\User\AccountController@accountRemove'); //用户账册删除
    Router::post('/card-save','App\Controller\User\CardController@cardSave'); //会员卡设置
    Router::post('/card-list','App\Controller\User\CardController@cardList'); //会员卡列表
    Router::post('/card-qrcode','App\Controller\User\CardController@cardQrcode'); //会员卡领取二维码
    Router::post('/card-receive','App\Controller\User\CardController@cardReceive'); //会员领取卡
    Router::post('/cards','App\Controller\User\CardController@userCardData'); //用户会员卡
    Router::post('/card-scan','App\Controller\User\CardController@userCardCancellation'); //二维码核销
    Router::post('/members','App\Controller\User\MemberController@index'); //我的会员
    Router::post('/members-save','App\Controller\User\MemberController@saveMemberCard'); //我的会员-修改/新增
    Router::post('/members-handle','App\Controller\User\MemberController@saveMemberCardUseHandle'); //我的会员-客户划卡
    Router::post('/cards-user-qrcode','App\Controller\User\CardController@showUserCardQrCode'); //用户会员卡二维码
},[
    'middleware' => [
        App\Middleware\AuthenticateSSO::class
    ]
]);
